﻿<Window x:Class="Wpf2.Views.ManageInventoryEditPrint"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Quản lý kho - Sửa trước khi in" Height="700" Width="Auto"  WindowStartupLocation="CenterScreen" WindowState="Maximized">
    <StackPanel Width="Auto" Orientation="Vertical" Background="#FF3C2AF9">
        <StackPanel Width="Auto"  Margin="0,10,0,0" Height="50" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
            <StackPanel Width="Auto" Orientation="Horizontal" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
                <Label Height="30" Content="Tên cửa hàng"></Label>
                <TextBox Name="txtStoreName" Text="KHANG HUY" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" 
         AcceptsReturn="True" Width="94" Height="20" Margin="0,15" ></TextBox>
                <Label Height="30" Content="Địa Chỉ" Margin="0,10,0,10" Width="54"/>
                <TextBox x:Name="txtAddress" Width="190" Height="20" Text="667 CMT8, KP2, Thị Xã Tây Ninh" Margin="0,15"/>
                <Label Height="30" Content="Di động" Margin="0,0,0,0"></Label>
                <TextBox Name="txtMobile" Width="72" Height="20" Text="0982777728" Margin="0,15" ></TextBox>
                <Label Height="30" Content="Điện thoại" Margin="0,0,0,0"></Label>
                <TextBox Name="txtPhone" Width="79" Height="20" Text="(066)2220333" Margin="0,15"></TextBox>
                <StackPanel Margin="10,0,20,0" HorizontalAlignment="Right"  Width="120" Height="30" Orientation="Horizontal">
                    <Button x:Name="btnPrint" Click="BtnPrintClick"  Width="90" Background="#16499A">
                        <TextBlock Foreground="#FFFCFCFC"> In</TextBlock>
                    </Button>
                    <StackPanel Width="30" Height="30" Background="#FF0050EF">
                        <Image Source="/Wpf2;component/Images/print.png" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </StackPanel>
        <StackPanel Width="Auto" Margin="10,0,10,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
            <DataGrid AutoGenerateColumns="False" CanUserAddRows="False"  Height="630" Width="Auto" x:Name="dtgProduct" ItemsSource="{Binding}" LoadingRow="DtgProductLoadingRow" AlternatingRowBackground="PaleTurquoise" Margin="0,10,0,0">
                <DataGrid.RowHeaderTemplate >
                    <DataTemplate>
                        <TextBlock  Width="30" Text="{Binding Header, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}, Mode=FindAncestor}}"/>
                    </DataTemplate>
                </DataGrid.RowHeaderTemplate>
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Mã SP Auto" Width="50"  Binding="{Binding ProductIdAuto, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True" Visibility="Hidden"/>
                    <DataGridTextColumn Header="Mã SP" Width="80"  Binding="{Binding ProductId, UpdateSourceTrigger=PropertyChanged}"/>
                    <DataGridTextColumn Header="Tên sản phẩm" Width="150" Binding="{Binding ProductName, UpdateSourceTrigger=PropertyChanged}"/>
                    <DataGridTextColumn Header="Mô tả" Width="150" Binding="{Binding ProductDescription, UpdateSourceTrigger=PropertyChanged}"/>
                    <DataGridTextColumn Header="SL" Width="40" Binding="{Binding InventoryCount, UpdateSourceTrigger=PropertyChanged}" IsReadOnly="True"/>
                    <DataGridTextColumn Header="Giá lẻ" Width="80" Binding="{Binding SellPrice, UpdateSourceTrigger=PropertyChanged,StringFormat={}\{0:###\,##0\}}"/>
                    <DataGridTextColumn Header="Giá sỉ" Width="80" Binding="{Binding CostPrice, UpdateSourceTrigger=PropertyChanged,StringFormat={}\{0:###\,##0\}}"/>
                    <DataGridTextColumn Header="Đơn vị" Width="100" Binding="{Binding UnitName, UpdateSourceTrigger=PropertyChanged}"/>
                    <DataGridTextColumn Header="Danh mục" Width="100" Binding="{Binding CatalogName, UpdateSourceTrigger=PropertyChanged}"/>
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
    </StackPanel>
</Window>
